<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>

        var a = 1 ;
        var b = a ;
        a++ ;
        // a的改变跟b没有关系
        console.log(b) ;   // 1



        var arr = [1,2,3] ;
        var arr2 = arr ;
        arr.push(5) ;
        // arr的改变影响了arr2
        console.log(arr2);   // [1,2,3,5]

    </script>
    
</body>
</html>